/*
 * XML Type:  XRadioButtonGroup
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XRadioButtonGroup
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XRadioButtonGroup(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XRadioButtonGroupImpl extends com.seedwill.xul.widget.impl.XInputImpl implements com.seedwill.xul.widget.XRadioButtonGroup
{
    private static final long serialVersionUID = 1L;
    
    public XRadioButtonGroupImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName RADIOS$0 = 
        new javax.xml.namespace.QName("", "radios");
    private static final javax.xml.namespace.QName CHECKEDINDEX$2 = 
        new javax.xml.namespace.QName("", "checkedIndex");
    
    
    /**
     * Gets array of all "radios" elements
     */
    public com.seedwill.xul.widget.XRadioButton[] getRadiosArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(RADIOS$0, targetList);
            com.seedwill.xul.widget.XRadioButton[] result = new com.seedwill.xul.widget.XRadioButton[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "radios" element
     */
    public com.seedwill.xul.widget.XRadioButton getRadiosArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XRadioButton target = null;
            target = (com.seedwill.xul.widget.XRadioButton)get_store().find_element_user(RADIOS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "radios" element
     */
    public int sizeOfRadiosArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(RADIOS$0);
        }
    }
    
    /**
     * Sets array of all "radios" element
     */
    public void setRadiosArray(com.seedwill.xul.widget.XRadioButton[] radiosArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(radiosArray, RADIOS$0);
        }
    }
    
    /**
     * Sets ith "radios" element
     */
    public void setRadiosArray(int i, com.seedwill.xul.widget.XRadioButton radios)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XRadioButton target = null;
            target = (com.seedwill.xul.widget.XRadioButton)get_store().find_element_user(RADIOS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(radios);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "radios" element
     */
    public com.seedwill.xul.widget.XRadioButton insertNewRadios(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XRadioButton target = null;
            target = (com.seedwill.xul.widget.XRadioButton)get_store().insert_element_user(RADIOS$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "radios" element
     */
    public com.seedwill.xul.widget.XRadioButton addNewRadios()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XRadioButton target = null;
            target = (com.seedwill.xul.widget.XRadioButton)get_store().add_element_user(RADIOS$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "radios" element
     */
    public void removeRadios(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(RADIOS$0, i);
        }
    }
    
    /**
     * Gets the "checkedIndex" element
     */
    public int getCheckedIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CHECKEDINDEX$2, 0);
            if (target == null)
            {
                return 0;
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) the "checkedIndex" element
     */
    public org.apache.xmlbeans.XmlInt xgetCheckedIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(CHECKEDINDEX$2, 0);
            return target;
        }
    }
    
    /**
     * True if has "checkedIndex" element
     */
    public boolean isSetCheckedIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CHECKEDINDEX$2) != 0;
        }
    }
    
    /**
     * Sets the "checkedIndex" element
     */
    public void setCheckedIndex(int checkedIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CHECKEDINDEX$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(CHECKEDINDEX$2);
            }
            target.setIntValue(checkedIndex);
        }
    }
    
    /**
     * Sets (as xml) the "checkedIndex" element
     */
    public void xsetCheckedIndex(org.apache.xmlbeans.XmlInt checkedIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(CHECKEDINDEX$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlInt)get_store().add_element_user(CHECKEDINDEX$2);
            }
            target.set(checkedIndex);
        }
    }
    
    /**
     * Unsets the "checkedIndex" element
     */
    public void unsetCheckedIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CHECKEDINDEX$2, 0);
        }
    }
}
